package com.hxzy.mapper;

import com.hxzy.dto.back.EmployeeSearchDTO;
import com.hxzy.entity.Employee;
import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 后台员工的数据访问
 */
@Mapper
public interface EmployeeMapper extends MyBatisBaseDao<Employee,BigDecimal> {

    /**
     * 根据登录名查询数据
     * @param account
     * @return
     */
    Employee findByLoginName(String account);

    /**
     * 分页查询
     * @param dto
     * @return
     */
    List<Employee> search(@Param(value = "dto") EmployeeSearchDTO dto);

    /**
     * 查询用户名是否被使用
     * @param loginName
     * @return
     */
    @Select(value = "select count(*) from EMPLOYEE where LOGIN_NAME=#{loginName}")
    int selectLoginNameCount(String loginName);
}